home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / WWW / MacHTTP Extras / Script Tools / Examples / File IO Example II < prev    next >
Text File  |  1993-07-08  |  383b  |  22 lines

  1. --
  2. --    Let the user pick a file to read
  3. --
  4. set newFile to choose file with prompt "Pick a file to read:" of type {"TEXT"}
  5.  
  6.  
  7. --
  8. --    Open the file and read through it
  9. --
  10. set refNum to open file newFile for reading
  11. try
  12.     repeat
  13.         set input to read file refNum
  14.         display dialog input buttons {"OK"} default button "OK"
  15.     end repeat
  16. on error
  17.     --
  18.     --    Assume EOF
  19.     --
  20.     close file refNum
  21. end try
  22.